﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>up6-本地文件上传示例</title>
    <link rel="stylesheet" type="text/css" href="res/up6/panel/up6.css" />
    <script type="text/javascript" src="res/jquery-1.4.min.js"></script>
    <script type="text/javascript" src="res/json2.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="res/up6/up6.edge.js" charset="utf-8"></script>
    <script type="text/javascript" src="res/up6/up6.app.js" charset="utf-8"></script>
    <script type="text/javascript" src="res/up6/panel/up6.file.js" charset="utf-8"></script>
    <script type="text/javascript" src="res/up6/panel/up6.folder.js" charset="utf-8"></script>
    <script type="text/javascript" src="res/up6/panel/up6.js" charset="utf-8"></script>
    <script language="javascript" type="text/javascript">
        //根路径：http://localhost/api/up6/
        var pos = window.location.href.lastIndexOf("/");
        var api = [
            window.location.href.substr(0, pos + 1),
            "api/up6/"
        ].join("");
        $(function () {
            var cbMgr = new HttpUploaderMgr({
                Config: {
                    License2: "",//授权码
                    FileFilter: "*",//限制上传的文件类型
                    //赋加字段，业务逻辑字段
                    Fields: { uid: 0 },
                    //后端接口-文件夹
                    "UrlFdCreate": api + "fd_create.aspx",
                    "UrlFdComplete": api + "fd_complete.aspx",
                    "UrlFdDel": api + "fd_del.aspx",
                    //后端接口-文件
                    "UrlCreate": api + "f_create.aspx",
                    "UrlPost": api + "f_post.aspx",
                    "UrlProcess": api + "f_process.aspx",
                    "UrlComplete": api + "f_complete.aspx",
                    "UrlList": api + "f_list.aspx",
                    "UrlDel": api + "f_del.aspx"
                },//事件
                event: {
                    md5Complete: function (obj, md5) {
                        //文件md5计算完毕
                    },
                    fileComplete: function (obj) {
                        //文件上传完毕
                    },
                    queueComplete: function () {
                        //队列中所有文件上传完毕
                        $(document.body).append("队列完成<br/>");
                    },
                    addFdError: function (jv) {
                        //添加文件夹错误
                        alert("本地路径不存在：" + jv.path);
                    },
                    scanComplete: function (obj) {
                        //目录扫描完毕
                    }
                },
                ui: {
                    render: $("#FilePanel")
                }
            });

            //上传指定文件
            $("#btnUpF").click(function () {
                var path = $("#filePath").val();
                cbMgr.addFile(path);
            });
            //上传指定目录
            $("#btnUpFd").click(function () {
                var path = $("#folderPath").val();
                cbMgr.addFolder(path);
            });
        });
    </script>
</head>
<body>
    <p>up6本地文件上传示例</p>
    <p><a href="api/up6/clear.aspx" target="_blank">上传-清空数据库</a></p>
    <p><a href="view/nosql/index.html" target="_blank">上传-多标签（NOSQL）</a></p>
    <p><a href="view/nosql/panel.html" target="_blank">上传-单面板（NOSQL）</a></p>
    <p><a href="index.html" target="_blank">上传-多标签</a></p>
    <p><a href="panel.html" target="_blank">上传-单面板</a></p>
    <p><a href="single.html" target="_blank">上传-单文件上传</a></p>
    <p><a href="localfile.html" target="_blank">上传-固定路径上传</a></p>
    <p><a href="vue.html" target="_blank">上传-vue.js引用</a></p>
    <p><a href="layer.html" target="_blank">上传-layer弹窗</a></p>
    <p><a href="filemgr.html" target="_blank">文件管理器示例</a></p>
    <p><a href="api/down2/clear.aspx" target="_blank">下载-清空数据库</a></p>
    <p><a href="down2.html" target="_blank">下载-下载示例</a></p>
    <p><a href="down2-ligerui.html" target="_blank">下载-ligerui示例</a></p>
    <!--ui-->
    <p>此页面用于演示上传本地指定路径（固定路径）的文件，比如可以将D:/Soft/QQ.exe上传到服务器中，不需要用户选择此文件。此功能用于特殊场景，比如扫描仪拍照后自动上传等。</p>
    <p>
        文件路径：<input id="filePath" type="text" size="50" value="D:\\360safe-inst.exe" />&nbsp;
        <input id="btnUpF" type="button" value="上传本地文件" />
    </p>
    <p>
        目录路径：<input id="folderPath" type="text" size="50" value="C:\\Users\\Administrator\\Desktop\\test" />&nbsp;
        <input id="btnUpFd" type="button" value="上传本地目录" />
    </p>
    <div id="FilePanel"></div>
    <div id="msg"></div>
</body>
</html>